package com.fit.dao.transportOffer;

import java.util.List;

import org.apache.tapestry5.ioc.annotations.Inject;
import org.hibernate.Session;

import com.fit.entities.TransportOffer;

public class TransportOfferDAOImpl implements TransportOfferDAO {

	@Inject
	private Session session;

	public boolean save(TransportOffer transportOffer) {
		if (transportOffer != null) {
			session.save(transportOffer);
			return true;
		}
		return false;
	}

	public TransportOffer findById(Long id) {
		return (TransportOffer) session.get(TransportOffer.class, id);
	}

	public List<TransportOffer> findAll() {
		return session.createCriteria(TransportOffer.class).list();
	}

}
